<template>
  <div id="editor" />
</template>

<script lang="ts">
import { Component, Prop, Vue } from "vue-property-decorator";
// lib
import Editor from "wangeditor";
// components & widgets
// config
// script & public
// controller & service
// interface
// 其它

@Component
export default class EditorContainer extends Vue {
  @Prop(String) sendHtml!: string;
  mounted() {
    const editor = new Editor("#editor");
    editor.config.onchange = (newHtml: any) => {
      this.$emit("getHtml", newHtml);
    };

    editor.create();
    editor.txt.html(this.sendHtml);
  }
}
</script>

<style lang="scss"></style>
